// src/router.js
'use strict'

export default function (router) {
  // 绑定路由到页面
  function comp (component) {
    return function (resolv) {
      require(['./components/' + component], resolv)
    }
  }

  // 路由map
  router.map({
    '/login': {
      component: comp('login')
    },
    '/home': {
      component: comp('projList')
    },
    '/project/:projectHash': {
      component: comp('taskList')
    }
  })

  router.redirect({
    '*': '/home'
  })
}
